﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Site
{
    public partial class Technology : UserControl
    {
        public Technology()
        {
            InitializeComponent();
            this.myMenu.Logo = "1";
            this.Loaded += new RoutedEventHandler(Technology_Loaded);
        }

        void Technology_Loaded(object sender, RoutedEventArgs e)
        {
            //菜单下滑动画
            DoubleAnimation animation = new DoubleAnimation();
            animation.From = -83;
            animation.To = 0;
            animation.Duration = new Duration(new TimeSpan(0, 0, 1));
            Storyboard.SetTarget(animation, myMenu);
            Storyboard.SetTargetProperty(animation, new PropertyPath(Canvas.TopProperty));
            Storyboard storyboard = new Storyboard();
            storyboard.Children.Add(animation);
            storyboard.Begin();
        }

        private void imgTech1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            App app = (App)Application.Current;
            Tech_Detail t = new Tech_Detail();
            t.DefaultTech = 0;
            app.RedirectTo(t);
        }

        private void btnTech2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            App app = (App)Application.Current;
            Tech_Detail t = new Tech_Detail();
            t.DefaultTech = 1;
            app.RedirectTo(t);
        }

        private void btnTech3_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            App app = (App)Application.Current;
            Tech_Detail t = new Tech_Detail();
            t.DefaultTech = 2;
            app.RedirectTo(t);
        }

        private void btnTech4_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            App app = (App)Application.Current;
            Tech_Detail t = new Tech_Detail();
            t.DefaultTech = 3;
            app.RedirectTo(t);
        }
    }
}
